﻿using Coldairarrow.Entity.BTB_StaffUsers;
using Coldairarrow.Entity.Goods;
using Coldairarrow.Entity.UserDTO;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace Coldairarrow.Business.BTB_StaffUsers
{
    public interface IBTB_StaffUserBusiness
    {
        Task<PageResult<BTB_StaffUser>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<string> OpenIdLogin(OpenIdInputDTO input);
        Task<string> OpenIdsLogin(OpenIdInputDTO input);
        Task<string> OPhoneLogin(OPhoneInputDTO input);
        Task<string> OpenIdRegistLogin(OpenIdRegistInputDTO data);
        Task<string> AppletOpenIdLogin(OpenIdInputDTO input);
        Task<string> AppletOpenIdsLogin(OpenIdInputDTO input);
        Task<string> AppletOPhoneLogin(OPhoneInputDTO input);
        Task<string> AppletOpenIdRegistLogin(OpenIdRegistInputDTO data);
        BTB_StaffUser GetTheDataAsync();
        string GetXcxEQImgData(string rootPath);
        object GetUserCPointAsync();
        object GetVCRDataAsync();
        object GetOrderSumDataAsync();
        BTB_ShippingAddress GetDFAddressAsnyc();
        Task AddDataAsync(BTB_StaffUser data);
        Task SaveSiteInfoAsnyc(SetSiteDTO input);
        Task ForgetPasswordAsync(UserForgetPassword data);
        Task ChangeUserState(IdInputDTO input);
        Task UpdateUserAsync(BTB_StaffUser data);
        Task DeleteDataAsync(List<string> ids);
        Task<string> PasswordLogin(LoginInputDTO input);
        Task<string> VerificationLogin(LoginInputDTO2 input);
        string GetOpenId(User user);
        Task<string> SaveData(User user);
        Task<string> SaveGZHData(User user);
        string GetEQImgData();
        BTB_StaffUser GetUserData();
        object GetAssetToken();
        PDiagramDTO GetMyDiagram(GetDiagramInput input);
        Task<List<GetSearchDTO>> GetSearchGoodList(GetSearchDTO input);

        string GetMyYQCode();
        /// <summary>
        /// 获取注册用户列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<BTB_StaffUser>> GetBackStaffUserListAsync(PageInput<ConditionDTO> input);
        Task UpdateYQCode(ChangeCodeDTO input);

    }

    public class UserForgetPassword
    { 
        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 验证码
        /// </summary>
        public string VerCode { get; set; }
        /// <summary>
        /// 验证码2
        /// </summary>
        public string Code { get; set; }

    }

    public class SetSiteDTO
    { 
        /// <summary>
        /// 经度
        /// </summary>
        public String Longitude { set; get; }

        /// <summary>
        /// 纬度
        /// </summary>
        public String Latitude { set; get; }
    }

    public class UrlDTO
    {
        [Required]
        public string url { get; set; }
    }

    /// <summary>
    /// 获取关系图查询条件
    /// </summary>
    public class GetDiagramInput
    {
        public string UserId { get; set; }
    }

    public class LoginInputDTO
    {
        [Required]
        public string userName { get; set; }

        [Required]
        public string password { get; set; }
    }

    public class GetSearchDTO
    {
        public string GoodName { get; set; }

        public string Id { get; set; }
    }

    public class ChangeCodeDTO
    {
        [Required]
        public string Id { get; set; }

        [Required]
        public string Code { get; set; }

    }

    /// <summary>
    /// 微信授权验证
    /// </summary>
    public class OpenIdInputDTO
    {
        [Required]
        public string OpenId { get; set; }

    }


    /// <summary>
    /// 微信授权绑定手机号
    /// </summary>
    public class OPhoneInputDTO
    {
        [Required]
        public string OpenId { get; set; }

        [Required]
        public string Phone { get; set; }

        public string Code { get; set; }

        public string verCode { get; set; }

    }

    public class OpenIdRegistInputDTO
    {
        [Required]
        public string Openid { get; set; }

        [Required]
        public string phone { get; set; }

        public string User_BYQCode { get; set; }

        [Required]
        public string Password { get; set; }


        public string NickName { get; set; }

        public string RaleName { get; set; }

        public int? Sex { get; set; }

        public string Address { get; set; }

        public string HeadPortrait { get; set; }

        public string access_token { get; set; }

    }


    public class LoginInputDTO2
    {
        [Required]
        public string userName { get; set; }

        public string verCode { get; set; }

        public string Code { get; set; }
    }

    public class DiagramDTO
    {
        public string Id { get; set; }
        public string SId { get; set; }
        public string NickName { get; set; }
        public string RaleName { get; set; }
        public int? Sex { get; set; }
        public string Phone { get; set; }
        public string HeadImg { get; set; }
        public int? HType { get; set; }
        public DateTime JoinTime { get; set; }
        public int UserCount { get; set; } = 0;

    }

    public class PDiagramDTO : DiagramDTO
    {
        public int? Code { set; get; }
        public string ParentId { set; get; }
        public List<DiagramDTO> Childs { get; set; }
    }

}